home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / desktop / vizeon / setup.exe / AppDir\Vizeon Office\Calculator2.swf / scripts / DefineButton2_3 / BUTTONCONDACTION on(release).as
Encoding:
Text File  |  2003-08-10  |  2.1 KB  |  97 lines

  1. on(release){
  2.    if(!isNaN(Mytext))
  3.    {
  4.       call(_root.DisplayMe(Mytext));
  5.    }
  6.    if(MyText == "." and _root.MyDot == false)
  7.    {
  8.       call(_root.DisplayMe(Mytext));
  9.       _root.MyDot = true;
  10.    }
  11.    if(IsNaN(MyText))
  12.    {
  13.       if(MyText == "=")
  14.       {
  15.          call(_root.Operation());
  16.       }
  17.       if(MyText == "+")
  18.       {
  19.          call(_root.Operation("+"));
  20.       }
  21.       if(MyText == "-")
  22.       {
  23.          call(_root.Operation("-"));
  24.       }
  25.       if(MyText == "/")
  26.       {
  27.          call(_root.Operation("/"));
  28.       }
  29.       if(MyText == "*")
  30.       {
  31.          call(_root.Operation("*"));
  32.       }
  33.       if(MyText == "M+")
  34.       {
  35.          _root.memory += Number(_root.display);
  36.       }
  37.       if(MyText == "MRC")
  38.       {
  39.          _root.display = _root.memory;
  40.          _root.memory = 0;
  41.          _root.clear = true;
  42.       }
  43.       if(MyText == "C")
  44.       {
  45.          _root.display = "0";
  46.          _root.MyDot = false;
  47.       }
  48.       if(MyText == "CE")
  49.       {
  50.          _root.operand1 = false;
  51.          _root.display = "0";
  52.          _root.operator = "";
  53.          _root.clear = false;
  54.          _root.MyDot = false;
  55.       }
  56.       if(MyText == "PI")
  57.       {
  58.          _root.display = "3.14159265";
  59.          _root.Clear = true;
  60.       }
  61.       if(MyText == "1/X")
  62.       {
  63.          _root.display = Number(_root.display / 2);
  64.          _root.Clear = true;
  65.       }
  66.       if(MyText == "X^2")
  67.       {
  68.          _root.display = Number(_root.display * _root.display);
  69.          _root.Clear = true;
  70.       }
  71.       if(MyText == "X^3")
  72.       {
  73.          _root.display = Number(_root.display * _root.display * _root.display);
  74.          _root.Clear = true;
  75.       }
  76.       if(MyText == "sqrt")
  77.       {
  78.          _root.display = Math.sqrt(_root.display);
  79.          _root.Clear = true;
  80.       }
  81.       if(MyText == "E")
  82.       {
  83.          _root.display = 2.718281828459045;
  84.          _root.Clear = true;
  85.       }
  86.       if(MyText == "pow")
  87.       {
  88.          call(_root.Operation("pow"));
  89.       }
  90.       if(MyText == "max")
  91.       {
  92.          _root.display = 1.7976931348623157e+308;
  93.          _root.Clear = true;
  94.       }
  95.    }
  96. }
  97.